package com.jvm.classloader;

/**
 * 调用ClassLoader类的loadClass方法去加载一个类并是对类的主动使用，所以并不会初始化一个类
 */
class CL{
    static {
        System.out.println("CL static block");
    }
}

public class MyTest12 {
    public static void main(String[] args) throws ClassNotFoundException {
        ClassLoader classLoader = ClassLoader.getSystemClassLoader();

        Class<?> clazz = classLoader.loadClass("com.jvm.classloader.CL");

        System.out.println(clazz);
        System.out.println("-------");

        clazz = Class.forName("com.jvm.classloader.CL");

        System.out.println(clazz);
    }
}
